export default class DebounceUnit {
  private _timer:any = null;
  private _delay = 60;
   public constructor(delay:number = 100){
        this._delay = delay;
   }
   public continue(fun:()=>void){
        if(this._timer != null)
        {
            clearTimeout(this._timer);
            this._timer = setTimeout(()=>{
                this._timer = null;
                fun();
            },this._delay);
            return false;
        }
        fun();
        this._timer = setTimeout(()=>{
            this._timer = null;
        },this._delay);
        return true;
   }


}